import { legacy_createStore, combineReducers, applyMiddleware } from "redux";
import reducers from "./reducers";
import thunk from "redux-thunk";
import createSagaMiddleware from "redux-saga";
import countSaga from "./saga/count";
const sagaMiddleware = createSagaMiddleware(); //创建saga中间件
const store = legacy_createStore(
  combineReducers(reducers),
  applyMiddleware(thunk, sagaMiddleware)
);
sagaMiddleware.run(countSaga); //运行指定的saga
export default store;
